from django.apps import AppConfig
import importlib
import os

class AdminzConfig(AppConfig):
    default_auto_field = 'django.db.models.BigAutoField'
    name = 'apps.adminz'

    def ready(self):
        super().ready()

        from django.apps import apps
        for app_config in apps.get_app_configs():
            try:
                importlib.import_module(f'{app_config.name}.adminz')
            except ImportError as e:
                if os.path.isfile(os.path.join(app_config.path, 'adminz.py')):
                    raise ImportError(f"Could not import adminz module for {app_config.name}: {e}")

        # self.module.autodiscover()


